﻿@{
    ViewBag.Title = "InfoPublish";
    Layout = "~/Areas/WorkSpace/Views/Shared/_CollegeAdminTemplete.cshtml";
}

<div id="content-header">
    <h1>招聘信息</h1>
</div>
<div id="breadcrumb">
	<a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>首页</a>
	<a href="/workspace/CollegeAdmin/InfoList" class="tip-bottom">发布管理</a>
	<a href="/workspace/CollegeAdmin/InfoPublish" class="current">发布信息</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
	    <div class="span12">
		    <div class="widget-box">
			    <div class="widget-title">
				    <span class="icon">
					    <i class="icon-align-justify"></i>									
				    </span>
				    <h5>发布招聘信息</h5>
			    </div>
			    <div class="widget-content nopadding">
				    <form id="frmpublish" action="/CollegeAdmin/SavePublishInfo" method="post" class="form-horizontal">
					    <input type="hidden" id="Id" name="Id" value="0" />
                        <div class="control-group">
                            <table>
                                <tr>
                                    <td>
                                        <label class="control-label">职位类型</label>
                                        <div class="controls">
		                                    <select id="Category" name="Category" style="width:100px;">
			                                    <option>兼职</option>
			                                    <option>实习</option>
		                                    </select>
	                                    </div>
                                    </td>
                                    <td style="text-align:left;">
                                        <label class="control-label">职位名称(*)</label>
                                        <div class="controls">
                                            <input type="text" id="Title" name="Title" style="width:158px;" class="required">
                                        </div>
                                    </td>
                                </tr>
                            </table> 
                        </div>
					    <div class="control-group">
                            <label class="control-label">招聘单位(*)</label>
                            <div class="controls">
                                <input type="text" id="RecruitDep" name="RecruitDep" style="width:430px;" class="required">
                            </div>
                        </div>
					    <div class="control-group">
                            <label class="control-label">薪资水平</label>
                            <div class="controls">
		                        <select id="SalaryLevel" name="SalaryLevel">
                                    <option>面议</option>
			                        <option>30-50</option>
			                        <option>50-100</option>
                                    <option>100-150</option>
			                        <option>150-200</option>
                                    <option>200-250</option>
			                        <option>>250</option>
		                        </select>&nbsp;<span>元/天</span>
	                        </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">招聘人数(*)</label>
                            <div class="controls">
                                <input type="text" id="RecruitNum" name="RecruitNum" style="width:206px;" class="required">&nbsp;<span>人</span>
                            </div>
                        </div>
                        
                        <div class="control-group">
	                        <label class="control-label">性别要求</label>
                            <div class="controls">
		                        <select id="SexReq" name="SexReq">
			                        <option>不限</option>
			                        <option>男</option>
                                    <option>女</option>
		                        </select>
	                        </div>
                        </div>
                        <div class="control-group">
	                        <label class="control-label">工作区域</label>
                            <div class="controls">
		                        <select id="WorkArea" name="WorkArea">
                                    <option value="区域">区域</option>
		                        </select>

                                <select id="DisCenter" name="DisCenter" disabled="disabled">
                                    <option value="商圈">商圈</option>
		                        </select>
	                        </div>
                        </div>
					    
                        <div class="control-group">
                            <label class="control-label">有效期(*)</label>
                            <div class="controls"> 
                                <input id="ExpireDate" readonly="readonly" name="ExpireDate" type="text" class="required" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd'})" style="width:206px"/>
                            </div>
                        </div>

                        <div class="control-group">
	                        <label class="control-label">职位描述(*)</label>
                            <div class="controls">
                                <script id="editor" name="JobDescrption" class="required" type="text/plain"></script>
                                <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_config.js"></script>
                                <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_all_min.js"></script>
                                <script type="text/javascript">
                                    UE.getEditor('editor');
                                </script>
	                        </div>
                        </div>
                        <div class="control-group">
                            <table>
                                <tr>
                                    <td>
                                        <label class="control-label">联系人(*)</label>
                                        <div class="controls">
                                            <input type="text" id="LinkMan" name="LinkMan" style="width:90px;" class="required">
                                        </div>
                                    </td>
                                    <td>
                                        <label class="control-label">联系电话(*)</label>
                                        <div class="controls">
                                            <input type="text" id="Phone" name="Phone" style="width:135px;" class="required">
                                        </div>
                                    </td>
                                    <td>
                                        <label class="control-label">联系邮箱</label>
                                        <div class="controls">
                                            <input type="text" id="EmailAdress" name="EmailAdress" style="width:190px;" class="email">
                                        </div>
                                    </td>
                                </tr>
                            </table> 
                        </div>
                        @{             
                            if (ViewBag.isSuccess != null)
                            {
                                if (ViewBag.isSuccess)
                                { 
                            <div class="alert alert-success">
                                <strong>信息发布成功！</strong>
                            </div>                
                                }
                                else
                                {
                            <div class="alert alert-error">
                                <strong>信息发布失败！</strong>
                            </div>                
                                }
                            }
                        }
                        <div class="form-actions">
						    <button type="submit" class="btn btn-primary">确认并发布</button>
					    </div>
				    </form>
			    </div>
		    </div>						
	    </div>
     </div>

</div>

@section tail{
<script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
<script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
<script type="text/javascript" src="/Scripts/messages_cn.js"></script>
<script type="text/javascript" src="/Scripts/plug.js"></script>

<script type="text/javascript">
    var validation = new plug.BindValidCode();
    $(function () {
        initarea();

        $('#likInfo').addClass('open');
        $('#likInfo').addClass('active');

        validation.BindValidator();
        $('#frmpublish').validate({
            errorClass: "help-inline",
            errorElement: "span",
            highlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').addClass('error');
            },
            unhighlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').removeClass('error');
            }
        });
    });

    jQuery.validator.addMethod("Phone", function (value, element) {
        var length = value.length;
        var mobile = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/
        return this.optional(element) || (length == 11 && mobile.test(value));
    }, "手机号码格式错误");

    var areadata = [
        { "area": "渝中区", "value": "2", "center": [{ "value": "21", "text": "解放碑" }, { "value": "22", "text": "大礼堂" }, { "id": "23", "text": "两路口" }, { "value": "24", "text": "大坪" }, { "value": "25", "text": "化龙桥"}] },
        { "area": "九龙坡区", "value": "3", "center": [{ "value": "31", "text": "杨家坪" }, { "value": "32", "text": "袁家岗" }, { "value": "33", "text": "石桥铺" }, { "value": "34", "text": "二郎" }, { "value": "35", "text": "巴国城"}] },
        { "area": "大渡口区", "value": "4", "center": [{ "value": "41", "text": "九宫庙" }, { "value": "42", "text": "马王乡" }, { "value": "43", "text": "新山村"}] },
        { "area": "南岸区", "value": "5", "center": [{ "value": "51", "text": "南坪" }, { "value": "52", "text": "南滨路" }, { "value": "53", "text": "弹子石" }, { "value": "54", "text": "上新街" }, { "value": "55", "text": "经开区" }, { "value": "56", "text": "学府大道" }, { "value": "57", "text": "茶园新区"}] },
        { "area": "沙坪坝区", "value": "6", "center": [{ "value": "61", "text": "沙坪坝" }, { "value": "62", "text": "磁器口" }, { "value": "63", "text": "新桥" }, { "value": "64", "text": "大学城" }, { "value": "65", "text": "陈家桥"}] },
        { "area": "江北区", "value": "7", "center": [{ "value": "71", "text": "观音桥" }, { "value": "72", "text": "五里店" }, { "value": "73", "text": "大石坝" }, { "value": "74", "text": "红旗河沟" }, { "value": "75", "text": "黄泥磅" }, { "value": "76", "text": "北滨路" }, { "value": "77", "text": "江北嘴"}] },
        { "area": "渝北区", "value": "8", "center": [{ "value": "81", "text": "两路" }, { "value": "82", "text": "回兴" }, { "value": "83", "text": "人和"}] },
        { "area": "巴南区", "value": "9", "center": [{ "value": "91", "text": "李家沱" }, { "value": "92", "text": "鱼洞" }, { "value": "93", "text": "界石"}] },
        { "area": "北部新区", "value": "10", "center": [{ "value": "101", "text": "大竹林" }, { "value": "102", "text": "礼嘉" }, { "value": "103", "text": "鸳鸯"}] },
        { "area": "北碚区", "value": "11", "center": [{ "value": "111", "text": "龙凤桥" }, { "value": "112", "text": "童家溪" }, { "value": "113", "text": "朝阳"}] }
    ];

    function initarea() {
        var areastr = '';
        $(areadata).each(function () {
            areastr += "<option value='" + this.area + "'>" + this.area + "</option>";
        });
        $("#WorkArea").append(areastr);
        };

        $("#WorkArea").change(function () {
            var wksel = $("#WorkArea").val();
            var centerstr = '';
            $("#DisCenter").empty();
            $("#DisCenter").append("<option value='商圈'>商圈</option>")
            if (wksel == "区域") {
                $("#DisCenter").attr("disabled", "disabled");
            }
            else {
                $("#DisCenter").removeAttr("disabled");
                $(areadata).each(function () {
                    if (this.area == wksel) {
                        $(this.center).each(function () {
                            centerstr += "<option value='" + this.text + "'>" + this.text + "</option>";
                        });

                        $("#DisCenter").append(centerstr);
                        return;
                    }
                    return;
                });
            }
        });


</script>
}